import Vue from 'vue'
import Vuex from 'vuex'
import jsCookie from 'js-cookie'
Vue.use(Vuex)

// 导出并且配置
export default new Vuex.Store({
  state: {
    status: false,
    // 是否完成支付的订单的状态
    OrderStatus: false,
    // 浏览记录吧
    // @ts-ignore
    // 购物车 规格的状态
    PurchaseStatus: false,
    // 地址信息
    Ress: '',
    // 进入我的订单后所要展示的页面
    // 存储提交订单的数据
    MyOrderStatus: -1,
    // 保存订单id
    OrderId: '',
    // 点击评论进来，保存当前的
    RebuyItem: '',
    SeeOrederItem: ''
  },
  mutations: {
    PassPurchaseStatus(state, param) {
      state.PurchaseStatus = param
    },
    PassRessItem(state, param) {
      state.Ress = param
    },
    PassOrderStatus(state, param) {
      state.OrderStatus = param
    },
    PassMyOrderStatus(state, param) {
      state.MyOrderStatus = param
    },
    PassOrderId(state, param) {
      state.OrderId = param
    },
    PassRebuyItem(state, param) {
      state.RebuyItem = param
    },
    PassSeeOreder(state, param) {
      state.SeeOrederItem = param
    }
  }
})
